<?php

use think\migration\Migrator;
use think\migration\db\Column;

class Resume extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
        $table = $this->table('resume',['engine'=>'MyISAM']);
        $table
            ->addColumn('name','string',['limit'=>32,'default'=>'','comment'=>'姓名'])
            ->addColumn('mobile','string',['limit'=>11,'default'=>'','comment'=>'手机号'])
            ->addColumn('resume_source','string',['limit'=>16,'default'=>'','comment'=>'简历来源'])
            ->addColumn('gender','string',['limit'=>2,'default'=>'','comment'=>'性别'])
            ->addColumn('birth_year','string',['limit'=>32,'default'=>'','comment'=>'出生日期'])
            ->addColumn('job_years','string',['limit'=>32,'default'=>'','comment'=>'工作时间'])
            ->addColumn('apply_job','string',['limit'=>32,'default'=>'','comment'=>'应聘岗位'])
            ->addColumn('education','string',['limit'=>32,'default'=>'','comment'=>'学历'])
            ->addColumn('birthplace','string',['limit'=>32,'default'=>'','comment'=>'籍贯'])
            ->addColumn('basic_info','string',['limit'=>521,'default'=>'','comment'=>'基础信息'])
            ->addColumn('school_items','string',['limit'=>1024,'default'=>'','comment'=>'教育背景'])
            ->addColumn('company_items','string',['limit'=>1024,'default'=>'','comment'=>'公司背景'])
            ->addColumn('note','string',['limit'=>255,'default'=>'','comment'=>'备注'])
            ->addColumn('status','boolean',['limit'=>3,'default'=>0,'comment'=>'状态'])
            ->addColumn('interview','datetime')
            ->addColumn('create_time','datetime')
            ->addColumn('update_time','datetime')
            ->create();
    }
}
